<template>
	<div>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-icon mui-icon-left-nav" @click="goBack"></a>
			<h1 class="mui-title">审批</h1>
		</header>	
		<div class="mui-content">
			<ul class="mui-table-view mui-grid-view mui-grid-9 attendanceList" style="margin-bottom: 10px;">
				<li class="mui-table-view-cell mui-media mui-col-xs-4">
					<router-link :to="{ name: 'WaitFlowList',params:{state:'0'} }" tag="a">
					<!--<router-link :to="{ name: 'Agree',params:{} }" tag="a">-->
							<span class="mui-icon wait-icon"></span>
							<div class="mui-media-body">待我审批</div>
					</router-link>
				</li>
				<li class="mui-table-view-cell mui-media mui-col-xs-4">
					<router-link :to="{ name: 'MyFlowList',params:{state:'1'} }" tag="a">
							<span class="mui-icon my-icon"></span>
							<div class="mui-media-body">我发起的</div>
					</router-link>
				</li>
				<li class="mui-table-view-cell mui-media mui-col-xs-4">
					<router-link :to="{ name: 'OverFlowList',params:{state:'2'} }" tag="a">
							<span class="mui-icon over-icon"></span>
							<div class="mui-media-body">我审核的</div>
					</router-link>
				</li>
			</ul>
			<ul class="mui-table-view mui-grid-view mui-grid-9 attendanceList">
				<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" v-for="list in flowlist">
					<router-link :to="{ name: list.StartPageMobile,params:{ Id: list.WorkflowId + '&null' } }" tag="a">
							<span :class="['mui-icon', list.StartPageMobile+'-icon']"></span>
							<div class="mui-media-body">{{list.WorkflowName}}</div>
					</router-link>
				</li>
				<!--<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
					<router-link :to="{ name: 'Meeting',params:{} }" tag="a">
							<span class="mui-icon meeting-icon"></span>
							<div class="mui-media-body">会议室申请</div>
					</router-link>
				</li>
				<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
					<router-link :to="{ name: 'Repair',params:{} }" tag="a">
							<span class="mui-icon repair-icon"></span>
							<div class="mui-media-body">报修申请</div>
					</router-link>
				</li>
				<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
					<router-link :to="{ name: 'Leave',params:{} }" tag="a">
							<span class="mui-icon leave-icon"></span>
							<div class="mui-media-body">请假申请</div>
					</router-link>
				</li>-->
			</ul>
		</div>
	</div>
</template>

<script>
import { saveToLocal } from '@/service/store';
import { flowList } from '@/service/getData';

	export default {
		data () {
			return {
				token:this.$route.params.token,
				schoolId: this.$route.params.schoolId,
				userId:this.$route.params.userId,
				flowlist:[]
			}
		},
		created() { 
			//存储个人信息
			saveToLocal( "myUser",{
				token: this.token,
				schoolId: this.schoolId,
				userId: this.userId
			})
			flowList({
				schoolId: this.schoolId,
				userId: this.userId,
			}).then((res) => {
				this.flowlist=res.data;
			});
		},
	}
</script>

<style scoped>
	li{
		height: 100px;
	}
	li a{
		width: 100%;
		height: 100%;
		padding: 0!important;
	}
	li a span{
		display: block;
		width: 100%;
		height: 62px;
		
	}
	li a span.my-icon{
		background: url(../../../static/img/my.png) no-repeat center;
		background-size: 60%;
	}
	li a span.over-icon{
		background: url(../../../static/img/over.png) no-repeat center;
		background-size: 60%;
	}
	li a span.wait-icon{
		background: url(../../../static/img/wait.png) no-repeat center;
		background-size: 60%;
	}
	li a span.Meeting-icon{
		background: url(../../../static/img/meeting.png) no-repeat center;
		background-size: 60%;
	}
	li a span.Repair-icon{
		background: url(../../../static/img/repair.png) no-repeat center;
		background-size: 60%;
	}
	li a span.Leave-icon{
		background: url(../../../static/img/expend.png) no-repeat center;
		background-size: 60%;
	}
	li a div{
		margin-top: 0!important;
		font-size: 16px;
	}
</style>